package com.helmlabs.grouper.cms.model;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class StaticContentModuleValidator implements ModuleValidator{
	
	private Log log = LogFactory.getLog(getClass());

	public Map validate(Object obj) {
		log.debug("+++++++ checking Static Content Module for the content");
		if (obj instanceof StaticContentModule ){
			log.debug("+++++++ checking Static Content Module for the content");
			Map errors = new HashMap();
			if (((StaticContentModule)obj).getContent()==null || "".equals(((StaticContentModule)obj).getContent())){
				errors.put("content", "Content is a required field");
				log.debug("+++++++ errors exist");
			}
			return errors;
		}
		return null;
	}
	
	

}
